home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
gnu
/
gnumake
/
gnumake.zoo
/
diffs
next >
Wrap
Text File
|
1990-02-16
|
22KB
|
882 lines
*** make-3.58/orig/arscan.c Fri Oct 20 01:46:34 1989
--- make-3.58/arscan.c Fri Feb 16 21:15:10 1990
***************
*** 24,30 ****
--- 24,34 ----
#define PORTAR 1
#endif
+ #ifdef GEMDOS
+ #include <gnu-ar.h>
+ #else
#include <ar.h>
+ #endif
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
***************
*** 266,271 ****
--- 270,279 ----
if (!pos)
return 1;
+ #ifdef GEMDOS
+ if (utime(arname, 0L) < 0) /* GEMDOS needs this to touch the file */
+ return -3;
+ #endif
fd = open (arname, O_RDWR, 0666);
if (fd < 0)
return -3;
***************
*** 280,286 ****
--- 288,298 ----
if (sizeof ar_hdr != write (fd, (char *) &ar_hdr, sizeof ar_hdr))
goto lose;
/* The file's mtime is the time we we want. */
+ #ifdef GEMDOS
+ stat(arname, &statbuf);
+ #else
fstat (fd, &statbuf);
+ #endif
#ifdef ARFMAG
/* Advance member's time to that time */
for (i = 0; i < sizeof ar_hdr.ar_date; i++)
*** make-3.58/orig/commands.c Mon Feb 12 19:43:02 1990
--- make-3.58/commands.c Mon Feb 12 19:23:34 1990
***************
*** 342,347 ****
--- 342,348 ----
int sig;
{
signal (sig, SIG_DFL);
+ #ifndef GEMDOS
#ifndef USG
(void) sigsetmask (0);
#endif
***************
*** 387,392 ****
--- 388,394 ----
wait_for_children (0, 1);
/* Delete any non-precious intermediate files that were made. */
+ #endif /* GEMDOS */
remove_intermediates (1);
*** make-3.58/orig/dir.c Wed Oct 4 01:12:46 1989
--- make-3.58/dir.c Mon Jan 29 22:47:32 1990
***************
*** 36,41 ****
--- 36,47 ----
#endif /* USGr3 or DIRENT. */
+ #ifdef GEMDOS
+ #define HASH_LIMIT 8 /* only consider this many characters of file names */
+ static short _limit = 0;
+ #endif
+
+
/* Hash table of directories. */
struct directory
***************
*** 83,94 ****
--- 89,108 ----
register char *p;
register struct directory *dir;
+ #ifdef GEMDOS
+ for (p = name, _limit = HASH_LIMIT; *p != '\0' && _limit-- > 0; ++p)
+ #else
for (p = name; *p != '\0'; ++p)
+ #endif
HASH (hash, *p);
hash %= DIRECTORY_BUCKETS;
for (dir = directories[hash]; dir != 0; dir = dir->next)
+ #ifdef GEMDOS
+ if (DOS_streq (dir->name, name))
+ #else
if (streq (dir->name, name))
+ #endif
break;
if (dir == 0)
***************
*** 151,157 ****
--- 165,175 ----
/* Checking if the directory exists. */
return 1;
+ #ifdef GEMDOS
+ for (p = filename,_limit = HASH_LIMIT; *p != '\0' && _limit-- > 0; ++p)
+ #else
for (p = filename; *p != '\0'; ++p)
+ #endif
HASH (hash, *p);
hash %= DIRFILE_BUCKETS;
***************
*** 158,164 ****
--- 176,186 ----
/* Search the list of hashed files. */
for (df = dir->files[hash]; df != 0; df = df->next)
+ #ifdef GEMDOS
+ if (DOS_streq (df->name, filename))
+ #else
if (streq (df->name, filename))
+ #endif
return !df->impossible;
}
***************
*** 174,180 ****
--- 196,206 ----
/* Enter the file in the hash table. */
register unsigned int newhash = 0;
register unsigned int i;
+ #ifdef GEMDOS
+ for (i = 0, _limit = HASH_LIMIT; i < D_NAMLEN(d) && _limit-- > 0; ++i)
+ #else
for (i = 0; i < D_NAMLEN(d); ++i)
+ #endif
HASH (newhash, d->d_name[i]);
newhash %= DIRFILE_BUCKETS;
df = (struct dirfile *) xmalloc (sizeof (struct dirfile));
***************
*** 184,191 ****
df->impossible = 0;
/* Check if the name matches the one we're searching for. */
! if (filename != 0
! && newhash == hash && streq (d->d_name, filename))
return 1;
}
--- 210,222 ----
df->impossible = 0;
/* Check if the name matches the one we're searching for. */
! if (filename != 0 && newhash == hash
! #ifdef GEMDOS
! && DOS_streq (d->d_name, filename)
! #else
! && streq (d->d_name, filename)
! #endif
! )
return 1;
}
***************
*** 251,257 ****
--- 282,293 ----
filename = p = dirend + 1;
}
+ #ifdef GEMDOS
+ _limit = HASH_LIMIT;
+ for (hash = 0; *p != '\0' && _limit-- > 0; ++p)
+ #else
for (hash = 0; *p != '\0'; ++p)
+ #endif
HASH (hash, *p);
hash %= DIRFILE_BUCKETS;
***************
*** 300,311 ****
--- 336,356 ----
/* There are no files entered for this directory. */
return 0;
+ #ifdef GEMDOS
+ _limit = HASH_LIMIT;
+ for (hash = 0; *p != '\0' && _limit-- > 0; ++p)
+ #else
for (hash = 0; *p != '\0'; ++p)
+ #endif
HASH (hash, *p);
hash %= DIRFILE_BUCKETS;
for (next = dir->files[hash]; next != 0; next = next->next)
+ #ifdef GEMDOS
+ if (DOS_streq (filename, next->name))
+ #else
if (streq (filename, next->name))
+ #endif
return next->impossible;
return 0;
***************
*** 381,383 ****
--- 426,469 ----
printf ("%u", impossible);
printf (" impossibilities in %u directories.\n", dirs);
}
+
+ #ifdef GEMDOS
+ /* checks to see if two names refer to the same file */
+ int DOS_streq(name1, name2)
+ char *name1, *name2;
+ {
+ static char _name1[64], _name2[64];
+ char *lastslash;
+ extern char *rindex();
+ int i;
+
+ if (!strcmp(name1, name2)) return 1;
+
+ unx2dos(name1, _name1);
+ unx2dos(name2, _name2);
+
+ name1 = rindex(_name1, '\\'); if (!name1) name1 = _name1;
+ name2 = rindex(_name2, '\\'); if (!name2) name2 = _name2;
+ for(i = 8; i>0; i--) {
+ if (*name1 != *name2) return 0;
+ if (*name1 == 0)
+ return 1;
+ if (*name1 == '.')
+ goto doext;
+ name1++; name2++;
+ }
+
+ /* now look for extension */
+ while (*name1 && *name1 != '.') name1++;
+ while (*name2 && *name2 != '.') name2++;
+ if (*name1 != *name2) return 0;
+ doext:
+ name1++; name2++;
+ for (i = 3; i > 0; i--) {
+ if (*name1 != *name2) return 0;
+ if (!*name1) return 1;
+ name1++; name2++;
+ }
+ return 1;
+ }
+ #endif /* GEMDOS */
*** make-3.58/orig/function.c Mon Feb 12 19:43:06 1990
--- make-3.58/function.c Mon Feb 12 19:24:16 1990
***************
*** 337,342 ****
--- 337,345 ----
else
buf[0] = '\0';
+ #ifdef GEMDOS
+ perror_with_name (buf, "function not allowed under GEMDOS");
+ #else
if (pipe (pipedes) < 0)
{
perror_with_name (buf, "pipe");
***************
*** 430,435 ****
--- 433,439 ----
free (buffer);
}
+ #endif /* GEMDOS */
free (text);
break;
}
*** make-3.58/orig/job.c Mon Feb 12 19:43:12 1990
--- make-3.58/job.c Tue Feb 13 18:50:50 1990
***************
*** 23,28 ****
--- 23,34 ----
#include "variable.h"
#include <errno.h>
+ #ifdef GEMDOS
+ #include <ctype.h>
+ extern char *findfile();
+ static char *_extensions[] = { "ttp", "prg", "tos", 0 };
+ #endif
+
extern int errno;
#if defined(USG) && !defined(HAVE_VFORK)
***************
*** 33,39 ****
#endif /* USG and don't have vfork. */
extern int vfork ();
! #if defined(HAVE_SYS_WAIT) || !defined(USG)
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
--- 39,45 ----
#endif /* USG and don't have vfork. */
extern int vfork ();
! #if (defined(HAVE_SYS_WAIT) || !defined(USG)) && !defined(GEMDOS)
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
***************
*** 62,67 ****
--- 68,84 ----
#else /* WTERMSIG not defined and have <sys/wait.h> or not USG. */
+ # ifdef GEMDOS
+ # define WAIT_T int
+ # define WTERMSIG(x) 0
+ # define WCOREDUMP(x) 0
+ # define WEXITSTATUS(x) x
+ # define WIFSIGNALED(x) (WTERMSIG (x) != 0)
+ # define WIFEXITED(x) (WTERMSIG (x) == 0)
+
+ # else
+
+
#define WAIT_T union wait
#define WTERMSIG(x) ((x).w_termsig)
#define WCOREDUMP(x) ((x).w_coredump)
***************
*** 70,75 ****
--- 87,94 ----
#define WIFSIGNALED(x) (WTERMSIG(x) != 0)
#endif
+ #endif /* GEMDOS */
+
#endif /* WTERMSIG defined or USG and don't have <sys/wait.h>. */
***************
*** 153,159 ****
--- 172,180 ----
Using the default action does the right thing. */
(void) signal (SIGCLD, SIG_DFL);
#else
+ # ifndef GEMDOS
(void) sigblock (sigmask (SIGCHLD));
+ # endif
#endif
block_remote